package fr.ajicommerce.core.entities;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "PHOTO")
//@Access(AccessType.FIELD)
public class Photo {

	@Id
	@GeneratedValue
	private Long idPhoto;
	
	private String nom;
	private String path;
	
	@Enumerated(EnumType.STRING)
	private TypePhoto typePhoto;

	@ManyToOne
	@JoinColumn(name="idProduit", nullable=false )
	protected Produit produit;

	public Photo() {
		super();
	}

	public Photo(String nom, String path, TypePhoto typePhoto, Produit produit) {
		this.nom = nom;
		this.path = path;
		this.typePhoto = typePhoto;
		this.produit = produit;
	}

	public Long getIdPhoto() {
		return idPhoto;
	}

	public void setIdPhoto(Long idPhoto) {
		this.idPhoto = idPhoto;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public TypePhoto getTypePhoto() {
		return typePhoto;
	}

	public void setTypePhoto(TypePhoto typePhoto) {
		this.typePhoto = typePhoto;
	}

	public Produit getProduit() {
		return produit;
	}

	public void setProduit(Produit produit) {
		this.produit = produit;
	}

}
